﻿param(
    [switch]$getName
)
$dllName = "ISEJumpListAddon.dll"
$script:scriptDir = split-path -parent $MyInvocation.MyCommand.path
function script:Run-Addon
{
    if(test-path "variable:psise")
    {
        $null = Add-Type -path $(Join-Path $script:scriptDir $dllName)
        $null = $psISE.CurrentPowerShellTab.VerticalAddOnTools.add([ISEJumpListAddon.AddonTab]::name, [ISEJumpListAddon.AddonTab], $true)
    }
    else
    {
        Write-Host "This can only be launched from Powershell ISE!"
    }
}

function script:Get-AddonName
{
    Add-Type -path $(Join-Path $script:scriptDir $dllName)
    return [ISEJumpListAddon.AddonTab]::name
}

if($getName)
{
    return script:Get-AddonName
}
else
{
    return Run-Addon
}